package com.csnf.hymall.service.impl;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.csnf.hymall.dao.ProductMapper;
import com.csnf.hymall.dao.ProductOrderMapper;
import com.csnf.hymall.dao.imp.ProductMapperImp;
import com.csnf.hymall.dao.imp.ProductOrderMapperImp;
import com.csnf.hymall.entity.OrderGroup;
import com.csnf.hymall.service.ProductService;

import java.text.SimpleDateFormat;
import java.util.*;

public class ProductServiceImp implements ProductService {
    ProductMapper productMapper = new ProductMapperImp();
    @Override
    public Integer getTotalByDate(String startDate, String endDate) {
        if (startDate == null || endDate == null) {
            startDate ="2010-01-01";
            SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
            endDate = simpleDateFormat.format(new Date());//当前时间
        }
        return productMapper.getTotalByDate(startDate,endDate);
    }
    }

